package com.woniuxy.hrp.provider;

import com.woniuxy.hrp.entity.Medicine;
import org.apache.ibatis.jdbc.SQL;

public class MedicineSqlProvider {
    //修改排班信息动态SQL
    public static String updateMedByCondition(Medicine medicine){
        String sql = new SQL(){
            {
                UPDATE("hrp_medicine");
                if (medicine.getName()!= null){
                    SET("name=#{name}");
                }
                if (medicine.getFee()!= null){
                    SET("fee=#{fee}");
                }
                if (medicine.getDescription() != null){
                    SET("description=#{description}");
                }
                WHERE("id=#{id}");
            }
        }.toString();
        return sql;
    }
}
